package Symulator2009;

import java.util.LinkedList;

class Cars{
	private LinkedList<Car> crs1;
	private LinkedList<Car> crs2;
	private LinkedList<Car> crs3;
	private LinkedList<Car> crs4;
	
	Cars(){
		crs1=new LinkedList<Car>();
		crs2=new LinkedList<Car>();
		crs3=new LinkedList<Car>();
		crs4=new LinkedList<Car>();
	}
	public void addCar(int i,Car c)
	{
		switch(i){
		case 1 : {
			crs1.add(c);
		}
		case 2 : {
			crs2.add(c);
		}
		case 3 : {
			crs3.add(c);
		}
		case 4 : {
			crs4.add(c);
		}
		default: System.err.println("bledny argument #002");
		}
	}
	public Car getCar(int i,int index)
	{
		Car car=null;
		switch(i){
		case 1 : {
			car=crs1.get(index);
		}
		case 2 : {
			car=crs2.get(index);
		}
		case 3 : {
			car=crs3.get(index);
		}
		case 4 : {
			car=crs4.get(index);
		}
		default: System.err.println("bledny argument #002");
		}
		return car;
	}
}
